package com.ruoyi.suppliers.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.suppliers.mapper.SuppliersMapper;
import com.ruoyi.suppliers.domain.Suppliers;
import com.ruoyi.suppliers.service.ISuppliersService;

/**
 * 供应商Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-09-26
 */
@Service
public class SuppliersServiceImpl implements ISuppliersService 
{
    @Autowired
    private SuppliersMapper suppliersMapper;

    /**
     * 查询供应商
     * 
     * @param id 供应商主键
     * @return 供应商
     */
    @Override
    public Suppliers selectSuppliersById(Integer id)
    {
        return suppliersMapper.selectSuppliersById(id);
    }

    /**
     * 查询供应商列表
     * 
     * @param suppliers 供应商
     * @return 供应商
     */
    @Override
    public List<Suppliers> selectSuppliersList(Suppliers suppliers)
    {
        return suppliersMapper.selectSuppliersList(suppliers);
    }

    /**
     * 新增供应商
     * 
     * @param suppliers 供应商
     * @return 结果
     */
    @Override
    public int insertSuppliers(Suppliers suppliers)
    {
        return suppliersMapper.insertSuppliers(suppliers);
    }

    /**
     * 修改供应商
     * 
     * @param suppliers 供应商
     * @return 结果
     */
    @Override
    public int updateSuppliers(Suppliers suppliers)
    {
        return suppliersMapper.updateSuppliers(suppliers);
    }

    /**
     * 批量删除供应商
     * 
     * @param ids 需要删除的供应商主键
     * @return 结果
     */
    @Override
    public int deleteSuppliersByIds(Integer[] ids)
    {
        return suppliersMapper.deleteSuppliersByIds(ids);
    }

    /**
     * 删除供应商信息
     * 
     * @param id 供应商主键
     * @return 结果
     */
    @Override
    public int deleteSuppliersById(Integer id)
    {
        return suppliersMapper.deleteSuppliersById(id);
    }

    @Override
    public Integer selIdBySupplierName(String supplierName) {
        return suppliersMapper.selectSupplierIdByName(supplierName);
    }
}
